import request from '@/router/axios';

export const getList = (current, size,params) => {
  return request({
    url: '/api/vehicleInfo/page',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const save = (data) => {
  return request({
    url: '/api/vehicleInfo/submit',
    method: 'post',
    data
  })
}

export const remove = (ids) => {
  return request({
    url: '/api/vehicleInfo/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const getLocationCodeList = (params) => {
  return request({
    url: '/api/vehicleInfoSub/list',
    method: 'get',
    params
  })
}

// 二维码
export const getQRCode = (id) => {
  return request({
    url: '/api/vehicleInfo/print',
    method: 'post',
    params: {
      id
    },
    responseType:'blob',
  })
}

// 条形码
export const getLocationCodePdf = (type, id) => {
  return request({
    url: '/api/vehicleInfo/pdf',
    method: 'post',
    params: {
      id,
      type
    },
    responseType:'blob',
  })
}


export const getSupplierListForCar = (supplierNameCode) => {
  return request({
    url: '/api/supplier/supplier/list',
    method: 'get',
    params:{
      supplierNameCode,
    }
  })
}
